<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\web\JsExpression;
/* @var $this yii\web\View */
/* @var $model common\models\business\BusinessSaleorder */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <div class="panel-body">
                <div class="adv-table editable-table ">
                    <div class="business-saleorder-form">
                        <?php $form = ActiveForm::begin([
                            'options' => ['class' => 'form-horizontal','enctype' => 'multipart/form-data'],
                            'fieldConfig' => [
                                'template' => "<div class='col-xs-3 col-sm-2 text-right'>{label}</div><div class='col-xs-9 col-sm-7'>{input}</div><div class='col-xs-12 col-xs-offset-3 col-sm-3 col-sm-offset-0'>{error}</div>",
                            ]
                        ]); ?>

                        <div id='formsub'>
                            <div class="form-group detail" style="width: 100%;margin-top: 20px">
                                <div style="float: left;width: 23%;margin-left: 1%">
                                    <input type="text" id="name" class="form-control" name="name[]" placeholder="名称">
                                </div>
                                <div style="float: left;width: 23%;margin-left: 1%">
                                    <input type="text" id="weight" class="form-control" name="weight[]" placeholder="重量">
                                </div>
                                <div style="float: left;width: 23%;margin-left: 1%">
                                    <input type="number" id="pigid" class="form-control" name="pigid[]" placeholder="仔猪">
                                </div>
                                <div style="float: left;width: 23%;margin-left: 1%">
                                    <input type="text" id="price" class="form-control" name="price[]" placeholder="价格">
                                </div>
                            </div>
                        </div>
                        <input type="hidden" name="_csrf" value="<?php Yii::$app->request->csrfToken ?>">
                        <div class="form-group" id="sub" style="margin-top: 20px;">
                            <?= Html::button('添加一项',['id'=>'ccopy','class'=>'btn btn-info']) ?>
                            <?= Html::submitButton($model->isNewRecord ? '确认提交' : '确认更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
                        </div>
                        <?php ActiveForm::end(); ?>


                    </div>
                </div>
            </div>
        </section>
    </div>
</div>



